added gtk_type_query() which returns a newly allocated structure holding
authorTim Janik <timj@gtk.org>
Tue, 8 Dec 1998 23:57:25 +0000 (23:57 +0000)
committerTim Janik <timj@src.gnome.org>
Tue, 8 Dec 1998 23:57:25 +0000 (23:57 +0000)
Wed Dec  9 00:49:12 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtktypeutils.h:
        * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly
        allocated structure holding certain type specific informations.
        fixed the big bunch of `discards const' warnings with the
        initialization of enum/flags values.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtksignal.h
gtk/gtktypeutils.c
gtk/gtktypeutils.h

index 1cb789ed7fcae52affe72658e5f6fa0bd29e9a65..f6e75a4e5dce12ffbf289b53223b99290cc399f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Dec  9 00:49:12 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly
+       allocated structure holding certain type specific informations.
+       fixed the big bunch of `discards const' warnings with the
+       initialization of enum/flags values.
+
 Tue Dec  8 15:10:17 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_transient_parent_realized):
index 1cb789ed7fcae52affe72658e5f6fa0bd29e9a65..f6e75a4e5dce12ffbf289b53223b99290cc399f8 100644 (file)
@@ -1,3 +1,11 @@
+Wed Dec  9 00:49:12 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly
+       allocated structure holding certain type specific informations.
+       fixed the big bunch of `discards const' warnings with the
+       initialization of enum/flags values.
+
 Tue Dec  8 15:10:17 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_transient_parent_realized):
index 1cb789ed7fcae52affe72658e5f6fa0bd29e9a65..f6e75a4e5dce12ffbf289b53223b99290cc399f8 100644 (file)
@@ -1,3 +1,11 @@
+Wed Dec  9 00:49:12 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly
+       allocated structure holding certain type specific informations.
+       fixed the big bunch of `discards const' warnings with the
+       initialization of enum/flags values.
+
 Tue Dec  8 15:10:17 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_transient_parent_realized):
index 1cb789ed7fcae52affe72658e5f6fa0bd29e9a65..f6e75a4e5dce12ffbf289b53223b99290cc399f8 100644 (file)
@@ -1,3 +1,11 @@
+Wed Dec  9 00:49:12 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly
+       allocated structure holding certain type specific informations.
+       fixed the big bunch of `discards const' warnings with the
+       initialization of enum/flags values.
+
 Tue Dec  8 15:10:17 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_transient_parent_realized):
index 1cb789ed7fcae52affe72658e5f6fa0bd29e9a65..f6e75a4e5dce12ffbf289b53223b99290cc399f8 100644 (file)
@@ -1,3 +1,11 @@
+Wed Dec  9 00:49:12 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly
+       allocated structure holding certain type specific informations.
+       fixed the big bunch of `discards const' warnings with the
+       initialization of enum/flags values.
+
 Tue Dec  8 15:10:17 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_transient_parent_realized):
index 1cb789ed7fcae52affe72658e5f6fa0bd29e9a65..f6e75a4e5dce12ffbf289b53223b99290cc399f8 100644 (file)
@@ -1,3 +1,11 @@
+Wed Dec  9 00:49:12 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly
+       allocated structure holding certain type specific informations.
+       fixed the big bunch of `discards const' warnings with the
+       initialization of enum/flags values.
+
 Tue Dec  8 15:10:17 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_transient_parent_realized):
index 1cb789ed7fcae52affe72658e5f6fa0bd29e9a65..f6e75a4e5dce12ffbf289b53223b99290cc399f8 100644 (file)
@@ -1,3 +1,11 @@
+Wed Dec  9 00:49:12 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtktypeutils.c: added gtk_type_query() which returns a newly
+       allocated structure holding certain type specific informations.
+       fixed the big bunch of `discards const' warnings with the
+       initialization of enum/flags values.
+
 Tue Dec  8 15:10:17 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_transient_parent_realized):
index 5287165b64bc6c22ecac6989b87ef0f5ec0625b4..1b803be0e99cdfac80c87fffea3c1ebb2f468fd2 100644 (file)
@@ -180,8 +180,8 @@ void   gtk_signal_set_funcs           (GtkSignalMarshal     marshal_func,
                                           GtkSignalDestroy     destroy_func);
 
 /* Report internal information about a signal. The caller has the
- *  responsibility to invoke a supsequent g_free (returned_data); but
- *  must not modify data pointed to by the members of GtkSignalQuery 
+ * responsibility to invoke a subsequent g_free (returned_data); but
+ * must not modify data pointed to by the members of GtkSignalQuery 
  */
 GtkSignalQuery* gtk_signal_query         (guint                signal_id);
 
index b7fcf60f5e468916958365129688029d954291ae..6ccc90eaa18daa903cfb5a8485c84da5b78b38bf 100644 (file)
@@ -798,9 +798,9 @@ gtk_type_get_varargs_type (GtkType foreign_type)
 }
 
 static inline GtkType
-gtk_type_register_intern (gchar               *name,
-                         GtkType       parent,
-                         GtkEnumValue *values)
+gtk_type_register_intern (gchar                     *name,
+                         GtkType             parent,
+                         const GtkEnumValue *values)
 {
   GtkType type_id;
   GtkTypeInfo info;
@@ -810,7 +810,7 @@ gtk_type_register_intern (gchar            *name,
   info.class_size = 0;
   info.class_init_func = NULL;
   info.object_init_func = NULL;
-  info.reserved_1 = values;
+  info.reserved_1 = (gpointer) values;
   info.reserved_2 = NULL;
   
   /* relookup pointers afterwards.
@@ -879,6 +879,26 @@ gtk_type_register_flags (const gchar       *type_name,
   return type_id;
 }
 
+GtkTypeQuery*
+gtk_type_query (GtkType type)
+{
+  GtkTypeNode *node;
+  
+  LOOKUP_TYPE_NODE (node, type);
+  if (node)
+    {
+      GtkTypeQuery *query;
+
+      query = g_new0 (GtkTypeQuery, 1);
+      query->type = type;
+      query->type_name = node->type_info.type_name;
+      query->object_size = node->type_info.object_size;
+      query->class_size = node->type_info.class_size;
+    }
+  
+  return NULL;
+}
+
 static guint
 gtk_type_name_hash (const char *key)
 {
@@ -945,7 +965,7 @@ gtk_type_init_builtin_types (void)
     gchar *type_name;
     GtkType *type_id;
     GtkType parent;
-    GtkEnumValue *values;
+    const GtkEnumValue *values;
   } builtin_info[GTK_TYPE_NUM_BUILTINS + 1] = {
 #include "gtktypebuiltins_ids.c"       /* type entries */
     { NULL }
index 40e70c2c40858fa33db2531e84eb282752c6a4dc..42bf9d809322a7987c3cc33c8da31071414c9e83 100644 (file)
@@ -132,6 +132,7 @@ GtkType             gtk_identifier_get_type         (void);
 typedef struct _GtkArg        GtkArg;
 typedef struct _GtkObject      GtkObject;   /* forward declaration of object type */
 typedef struct _GtkTypeInfo    GtkTypeInfo;
+typedef struct _GtkTypeQuery   GtkTypeQuery;
 typedef struct _GtkEnumValue   GtkEnumValue;
 typedef struct _GtkEnumValue   GtkFlagValue;
 
@@ -302,6 +303,14 @@ struct _GtkTypeInfo
   GtkClassInitFunc      base_class_init_func;
 };
 
+struct _GtkTypeQuery
+{
+  GtkType               type;
+  const gchar          *type_name;
+  guint                         object_size;
+  guint                         class_size;
+};
+
 struct _GtkEnumValue
 {
   guint         value;
@@ -347,6 +356,11 @@ GtkFlagValue*      gtk_type_flags_find_value       (GtkType         flag_type,
 void           gtk_type_set_varargs_type       (GtkType        foreign_type,
                                                 GtkType        varargs_type);
 GtkType                gtk_type_get_varargs_type       (GtkType        foreign_type);
+/* Report internal information about a type. The caller has the
+ * responsibility to invoke a subsequent g_free (returned_data); but
+ * must not modify data pointed to by the members of GtkTypeQuery
+ */
+GtkTypeQuery*  gtk_type_query                  (GtkType        type);